tools: add babl-verify start of an development aid when improving fast paths
authorØyvind Kolås <pippin@gimp.org>
Wed, 16 Nov 2016 19:40:58 +0000 (20:40 +0100)
committerØyvind Kolås <pippin@gimp.org>
Sat, 19 Nov 2016 11:51:27 +0000 (12:51 +0100)
This tool take the names of source/target formats - and prints error/cost for
all direct conversions matching arguments.

tools/babl-verify.c [new file with mode: 0644]

diff --git a/tools/babl-verify.c b/tools/babl-verify.c
new file mode 100644 (file)
index 0000000..15654e2
--- /dev/null
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "babl/babl.h"
+
+int main (int argc, char **argv)
+{
+  if (argc != 3)
+  {
+    fprintf (stderr, "need two args, from and to babl-formats\n");
+    return -1;
+  }
+  setenv ("BABL_DEBUG_CONVERSIONS", "1", 0);
+  babl_init ();
+  babl_fish (babl_format(argv[1]), babl_format (argv[2]));
+  babl_exit ();
+
+  return 0;
+}